de.ueberdosis.mp3info
Class ID3Reader
java.lang.Object
|
+--de.ueberdosis.mp3info.ID3Reader
- All Implemented Interfaces:
- Defines
- Direct Known Subclasses:
- id3
- public class ID3Reader
- extends java.lang.Object
- implements Defines
ID 3 version 1.6.0 and Bitrate reader
Milon Krejca , Florian Heer , (c) 2000
Field Summary |
protected static de.ueberdosis.mp3info.id3v2.ID3V2Tag |
v2tag
|
protected de.ueberdosis.mp3info.ExtendedID3Tag |
xtag
stores one extended Tag. |
Constructor Summary |
ID3Reader(java.lang.String filename)
|
Method Summary |
void |
checkAllFrames(java.io.RandomAccessFile in)
Reads all frames sequentially. |
boolean |
checkVBR(java.io.RandomAccessFile raf)
Checks a file for encoding with variable bitrate. |
de.ueberdosis.mp3info.ExtendedID3Tag |
getExtendedID3Tag()
gives you the parsed tag |
static de.ueberdosis.mp3info.id3v2.ID3V2Tag |
getV2Tag()
Gives you the last encountered ID3V2Tag. |
static void |
main(java.lang.String[] args)
|
static de.ueberdosis.mp3info.ExtendedID3Tag |
readExtendedTag(java.io.RandomAccessFile in)
reads an extended ID3Tag from the given file. |
static de.ueberdosis.mp3info.ID3Tag |
readTag(java.io.RandomAccessFile in)
This reads an ID3V1Tag from the given File. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
xtag
protected de.ueberdosis.mp3info.ExtendedID3Tag xtag
- stores one extended Tag. Relict from the days I only had V1 tags to worry about
v2tag
protected static de.ueberdosis.mp3info.id3v2.ID3V2Tag v2tag
ID3Reader
public ID3Reader(java.lang.String filename)
throws java.io.IOException
readTag
public static de.ueberdosis.mp3info.ID3Tag readTag(java.io.RandomAccessFile in)
throws java.io.IOException
- This reads an ID3V1Tag from the given File.
java.io.IOException
readExtendedTag
public static de.ueberdosis.mp3info.ExtendedID3Tag readExtendedTag(java.io.RandomAccessFile in)
throws java.io.IOException
- reads an extended ID3Tag from the given file. Apart from things like
artist and title, also bitrate and mpegID are read.
This method just reads the first frame it can find. VBR-files definitely
result in wrong playing times, as the bitrate is VARIABLE.
To get reliable information on VBR-files checkAllFrames () must
be called afterwards!
java.io.IOException
getExtendedID3Tag
public de.ueberdosis.mp3info.ExtendedID3Tag getExtendedID3Tag()
- gives you the parsed tag
getV2Tag
public static de.ueberdosis.mp3info.id3v2.ID3V2Tag getV2Tag()
- Gives you the last encountered ID3V2Tag.
The tag gets nulled everytime a method is called that
could encounter a V2 tag (e.g. checkAllFrames, readExtendedTag...)
This is primarily for developers that call the methods defined
in Version 1.5. The information flow will change a bit soon.
- Returns:
- a tag or null
checkVBR
public boolean checkVBR(java.io.RandomAccessFile raf)
throws java.io.IOException
- Checks a file for encoding with variable bitrate.
The positions at which a possible frameheader is looked for are
defined in Defines.java. They are always relative to possibly
encountered V2-tags.
- Returns:
- true if the file is VBR. false, if this method only encountered
frames with the same bitrates. This is not a definitive
check, only a high possibility check!
java.io.IOException
checkAllFrames
public void checkAllFrames(java.io.RandomAccessFile in)
throws java.io.IOException
- Reads all frames sequentially.
It counts the frames and computes the playing time of a file.
Caution: this method is not supposed to be public. It is so only
at this time of development and may be altered in the next release!
Since 1.6.0d2 this has to be called only if
- a file is encoded in VBR and you want the real time (not one that might be
entered in an ID3v2 tag, thus having the real time even if the file was not
completely transferred.
- a file is encoded with a fixed bitrate but may contain an ID3v2 tag
If you have a fixed bitrate file (@see checkVBR ()) and you are sure the file
contains (apart from an ID3v1 tag) only musical data, you do not need to call
this time consuming method.
- Parameters:
in
- the file to be examined.
java.io.IOException
main
public static void main(java.lang.String[] args)